set totalPieces to noOfPiecesAcross * noOfPiecesDown
set the visible of sprite VCrossHairNo to 1
set the visible of sprite HCrossHairNo to 1
repeat with x = startTargetNo to endTargetNo
set piecesAcross to random(noOfPiecesAcross)
set piecesDown to random(noOfPiecesDown)
put piecesAcross && piecesDown into line x of currTargetLocs
set the locH of sprite x to leftPuzzleH + (piecesAcross * pieceWidth)
set the locV of sprite x to topPuzzleV + (piecesDown * pieceHeight)
end repeat
updateStage()
repeat while the mouseMember = member "kiss mask"
if (the ticks - targetTimer) > 20 then
if currTarget = endTargetNo then
set currTarget to startTargetNo
else
set currTarget to currTarget + 1
end if
set targetTimer to the ticks
set piecesAcross to random(noOfPiecesAcross)
set piecesDown to random(noOfPiecesDown)
put piecesAcross && piecesDown into line currTarget of currTargetLocs
set the locH of sprite currTarget to leftPuzzleH + (piecesAcross * pieceWidth)
set the locV of sprite currTarget to topPuzzleV + (piecesDown * pieceHeight)
updateStage()
end if
if not (kissTimer = 0) then
if (the ticks - kissTimer) > 10 then
set the visible of sprite kissSpriteNo to 0
set kissTimer to 0
end if
end if
set the locV of sprite VCrossHairNo to the mouseV
set the locH of sprite HCrossHairNo to the mouseH
updateStage()
cursor(2)
if the mouseDown then
puppetSound("kiss")
set the locH of sprite kissSpriteNo to the locH of sprite HCrossHairNo
set the locV of sprite kissSpriteNo to the locV of sprite VCrossHairNo
set the visible of sprite kissSpriteNo to 1
updateStage()
set testV to the locV of sprite kissSpriteNo
set testH to the locH of sprite kissSpriteNo
repeat with spriteNo = startTargetNo to endTargetNo
if (abs(the locV of sprite spriteNo - testV) < 50) and (abs(the locH of sprite spriteNo - testH) < 50) then
set spriteToHide to ((value(word 2 of line spriteNo of currTargetLocs) - 1) * noOfCardsAcross) + value(word 1 of line spriteNo of currTargetLocs) + (firstRevealCard - 1)